package ${dtoPackage?lower_case};

import org.springframework.beans.BeanUtils;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

@Data
public class ${bizName?cap_first}Dto {
	<#assign typeparser= "com.lemon.components.ant.util.freemarker.JdbcTypeParse2Java"?new()/>
	<#assign nameparser= "com.lemon.components.ant.util.freemarker.JdbcNameParse2Java"?new()/>
	<#assign fetchComment= "com.lemon.components.ant.util.freemarker.FetchJdbcComment"?new()/>
	
	<#list 1..(resultSetMetaData.getColumnCount()) as i>
	@Schema(description = "${fetchComment(resultSetMetaData.getTableName(i),resultSetMetaData.getColumnLabel(i))}")
	private ${typeparser(resultSetMetaData.getColumnTypeName(i),resultSetMetaData.getScale(i))} ${nameparser(resultSetMetaData.getColumnLabel(i))};
	
	</#list>
	
	public static ${bizName?cap_first}Dto toDto(${bizName?cap_first}Model model) {
		${bizName?cap_first}Dto dto = new ${bizName?cap_first}Dto();
        BeanUtils.copyProperties(model, dto);
        return dto;
    }
}